<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
    <title>编辑用户</title>
    <jsp:include page="../../include/head.jsp"/>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox-content">
                <form class="form-horizontal m-t" id="signupForm">
                    <input type="hidden" name="_method" value="put">
                    <input id="id" name="id" value="${user.id}"
                           type="hidden">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">姓名：</label>
                        <div class="col-sm-8">
                            <input id="nickname" name="nickname" class="form-control" type="text"
                                   value="${user.nickname}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">用户名：</label>
                        <div class="col-sm-8">
                            <input id="username" name="username" class="form-control"
                                   type="text" value="${user.username}" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">部门：</label>
                        <div class="col-sm-8">
                            <input id="deptId" name="deptId" class="hidden" value="${user.deptId}">
                            <input id="deptName" name="deptName"
                                   class="form-control" type="text" style="cursor: pointer;"
                                   onclick="openDept()" readonly="readonly" placeholder="所属部门" value="${user.deptName}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">状态:</label>
                        <div class="col-sm-8">
                            <label class="radio-inline">
                                <input type="radio" name="status" value="1"
                                       <c:if test="${user.status=='1'}">checked</c:if> />正常
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name="status" value="0"
                                       <c:if test="${user.status=='0'}">checked</c:if> />禁用
                            </label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">角色</label>
                        <div class="col-sm-8">
                            <c:forEach items="${roles}" var="role">
                                <label class="checkbox-inline">
                                    <input name="roles" type="checkbox" value="${role.id}"
                                           <c:if test="${role.checked}">checked="checked"</c:if>  />
                                        ${role.showname}
                                </label>
                            </c:forEach>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-8 col-sm-offset-3">
                            <button type="submit" class="btn btn-primary">提交</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<jsp:include page="../../include/footer.jsp"/>
<script type="text/javascript" src="app/resources/js/appjs/admin/user/userEdit.js">
</script>
</body>
</html>
